<?php

abstract class User_Library_Controller_Action extends APPCore_Controller_Action
{
    protected $_model;
    protected $_form;

    public function init()
    {
        parent::init();
        $config = Zend_Registry::get('configuration');
        $this->getRequest()->setParam('language', $config->site->FrontLangDefault);
    }

    public function generateCode($type)
    {
        $result = '';
        switch ($type) {
            case 'active':
                $result = sha1(mt_rand(100000,999999).time());
                break;
            case 'verify':
                $result = mt_rand(100000,999999);
                break;
            case 'forgot-password':
                $result = sha1(mt_rand(100000,999999).time());
                break;
            default:
                break;
        }

        return $result;
    }
}